<?php
class Privileges_Model_Insertprivilegeaction implements Privileges_Model_Mainable{
    
    private $privileges_data_insertprivilege;
    private $escepted_result = 1;
    private $current_result;
    private $action_handler;
    
    public function __construct() {
        $this->privileges_data_insertprivilege = new Privileges_Data_Insertprivilege;
    }
    
    public function main(array $variables = null) {
        $this->current_result = $this->privileges_data_insertprivilege->main($variables);
        if($this->current_result = $this->escepted_result){
            $this->action_handler = new Privileges_Data_Privilegeredirect;
            return $this->action_handler->main($variables);
        }
        else {
            $this->action_handler = new Privileges_Data_Privilegeerrormessage;
            return $this->action_handler->main($variables);
        }
    }

}
